package com.wc.算法基础课.E第五讲动态规划.状压DP.国际象棋;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/27 21:36
 * @description https://www.acwing.com/problem/content/3497/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 6, M = 110, K = 22;
    // f[i][a][b][k] 第i - 1行状态为a，第i行状态为b ，一共拥有k个马的方案数
    static int[][][][] f = new int[M][1 << N][1 << N][K];
    static int P = (int) 1e9 + 7;
    static int n, m, k;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        k = sc.nextInt();
        // f[0][0][0][0] = 1,就是什么都没有
        f[0][0][0][0] = 1;
        // 三列 c 表示 i - 2行, a 表示 i - 1行， b表示i行，首先要解决i - 1与i的冲突，然后再解决i-2与i-1的冲突 i - 2与 i的冲突
        for (int i = 1; i <= m; i++) {
            for (int a = 0; a < 1 << n; a++) {
                for (int b = 0; b < 1 << n; b++) {
                    // 第i - 1行和第i - 2行不冲突
                    if ((a & (b << 2)) > 0 || (b & (a << 2)) > 0) continue;
                    // c表示的是i行状态
                    for (int c = 0; c < 1 << n; c++) {
                        if ((b & (c << 1)) > 0 || (c & (b << 1)) > 0) continue;
                        if ((a & (c << 2)) > 0 || (c & (a << 2)) > 0) continue;
                        // 得到第b状态下的马
                        int t = getCount(b);
                        for (int j = t; j <= k; j++) {
                            f[i][a][b][j] = (f[i][a][b][j] + f[i - 1][c][a][j - t]) % P;
                        }
                    }
                }
            }
        }
        int res = 0;
        for (int i = 0; i < 1 << n; i++) {
            for (int j = 0; j < 1 << n; j++) {
                res = (res + f[m][i][j][k]) % P;
            }
        }
        out.println(res);
        out.flush();
    }

    static int getCount(int x) {
        int res = 0;
        while (x > 0) {
            res++;
            x -= x & -x;
        }
        return res;
    }

}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}